<template>
	<view>
		<u-parse :content="content"></u-parse>
	</view>
</template>

<script>
	import {
		getProtocolDetail
	} from '@/api/index.js'
	export default {
		onLoad(option) {
			if (option.type) {
				this.getProtocol(option.type)
			} else {
				uni.navigateBack()
			}
		},
		data() {
			return {
				content: '',
			}
		},
		methods: {
			async getProtocol(id) {
				const res = await getProtocolDetail(id)
				if (res.code === 200) {
					uni.setNavigationBarTitle({
						title: res.data.title
					});
					this.content = res.data.content
				}
			}
		}
	}
</script>

<style>

</style>
